﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebSite.Core;
using Common;

namespace WebSite.Server
{
    /// <summary>
    /// WannaJoinAction 的摘要说明
    /// </summary>
    public class WannaJoinAction : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            // context.Response.CacheControl = "no-cache";
            // context.Response.Cache.SetNoStore();

            if (Project_Session.CurrentUserID == 0)
            {
                context.Response.Redirect( "/reg.aspx" );
            }
            //else if (Project_Session.CurrentUserBaby == null)
            //{
            //    context.Response.Redirect( "/submitinfo.aspx" );
            //}
            //else if (NullableHelper.CastValueType(Project_Session.CurrentUserBaby.ConfirmTeamId) == 0)
            //{
            //    context.Response.Redirect( "/LookingForTeam.aspx" );
            //}
            else
            {
                context.Response.Redirect( "/babylist.aspx" );
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}